package kernel.db.basics;


import java.sql.SQLException;
import java.sql.ResultSet;

public class Typeinscription extends DBOperator{

	/* ############################### Fields ############################### */
	private int IdTypeInscription;

	private String NomTypeInscription;

	/* ############################### Getters ############################## */
	public int getIdTypeInscription(){
		return IdTypeInscription;
	}

	public String getNomTypeInscription(){
		return NomTypeInscription;
	}

	/* ############################### Setters ############################## */
	public void setIdTypeInscription(int newValue){
		this.IdTypeInscription = newValue;
	}

	public void setNomTypeInscription(String newValue){
		this.NomTypeInscription = newValue;
	}

	/* ########################### CLASS CONSTRUCTORS ####################### */
	public Typeinscription(String NomTypeInscription) throws SQLException {
		this.NomTypeInscription = NomTypeInscription;
		this.IdTypeInscription = executeUpdate("INSERT INTO typeinscription VALUES('DEFAULT','"+NomTypeInscription+"')");
	}

	public Typeinscription(int IdTypeInscription) throws SQLException {
		ResultSet rs = executeSelect("SELECT * FROM typeinscription WHERE IdTypeInscription='"+IdTypeInscription+"'");
				this.IdTypeInscription = rs.getInt(IdTypeInscription);

	}
}